import type { CouponRequestParams } from '@/types/api/coupon'
import request from '@/utils/request'

// 获取优惠券列表
export const getCouponListAPI = () => request.get('/api/coupon')

// 兑换（创建）优惠券
export const addCouponItemAPI = (data: CouponRequestParams): Promise<any> => request.post('/api/coupon', data)

// 使用优惠券
export const deleteCouponItemAPI = (id: number) => request.delete(`/api/coupon/${id}`)
